Editor Questions

Started by walt decker, July 08, 2026, 08:36:56 PM

Previous topic - Next topic

walt decker

The first time I down-loaded the editor, about 2 months ago, there were 2 versions.  I down-loaded it again this morning and there was 1 version.  So:

1)  Is it compiling 32 or 64 bit code?
2)  How does one get rid of the black console?

I commend you on the new work you have done.  The debugger works much better than the older version.

PS:  In the help you mention a preference tab.  There is no preference tab.  Preferences are in the little cog icon.

Paul Squires

Quote from: walt decker on July 08, 2026, 08:36:56 PM1)  Is it compiling 32 or 64 bit code?
That depends on whatever "Build Confguration" that you choose for your code. You can use any of the existing Build Configurations or create your own. There are configurations for both 32-bit and 64-bit so to answer your question: It can compile both 32-bit or 64-bit.

Build Configurations can be accessed in several ways:
- Top menu:  "File" / "Preferennces" / "Build Configurations"
- Simply Pressing The "F7" keyboard key.
- In the statusbar at the bottom of the editor you'll see a "+" icon located right next to the currently active build configuaration. Click on it.

Quote2)  How does one get rid of the black console?
Sounds to me like your "Build Configuration" is set to one of the console builds which includes the compiler option "-s console". Try selecting one of the "Win32 GUI" or "Win64 GUI" build configurations.

QuoteI commend you on the new work you have done.  The debugger works much better than the older version.
Awesome, thanks! The debugger is not the best by any stretch of the imagination. It is a tough piece of software to interface to.

QuotePS:  In the help you mention a preference tab.  There is no preference tab.  Preferences are in the little cog icon.
That cog icon is a shortcut to "Environment Options".
The "Preferences" is most likely referring to the top menu item that has several submenu items:
"File", "Preferences":
  - Environment Options
  - Build Configurations
  - Keyboard Shortcuts

As you have noticed, writing Help documentation is not my strong suit.

Eventually, I hope to create Youtube videos that will better explain visually how to use the editor in practice. However, before I can do that, I am in the midst of a redesign of the "Find", "Replace" and "Find in Files" functionality. Similarly, I am adding a fuzzy finder type of search option so you can type in a popup dialog and it will give you fast results for matches on things like filenames, sub/function names, TYPES/ENUMS, etc. That should help making navigation in large projects much easier.
Paul Squires
PlanetSquires Software

walt decker

Thank you.  I was not looking for preferences in the files menu item.

rnbw

Quote from: Paul Squires on July 08, 2026, 09:34:50 PM
Quote from: walt decker on July 08, 2026, 08:36:56 PM1)  Is it compiling 32 or 64 bit code?
That depends on whatever "Build Confguration" that you choose for your code. You can use any of the existing Build Configurations or create your own. There are configurations for both 32-bit and 64-bit so to answer your question: It can compile both 32-bit or 64-bit.

Build Configurations can be accessed in several ways:
- Top menu:  "File" / "Preferennces" / "Build Configurations"
- Simply Pressing The "F7" keyboard key.
- In the statusbar at the bottom of the editor you'll see a "+" icon located right next to the currently active build configuaration. Click on it.

Quote2)  How does one get rid of the black console?
Sounds to me like your "Build Configuration" is set to one of the console builds which includes the compiler option "-s console". Try selecting one of the "Win32 GUI" or "Win64 GUI" build configurations.

QuoteI commend you on the new work you have done.  The debugger works much better than the older version.
Awesome, thanks! The debugger is not the best by any stretch of the imagination. It is a tough piece of software to interface to.

QuotePS:  In the help you mention a preference tab.  There is no preference tab.  Preferences are in the little cog icon.
That cog icon is a shortcut to "Environment Options".
The "Preferences" is most likely referring to the top menu item that has several submenu items:
"File", "Preferences":
  - Environment Options
  - Build Configurations
  - Keyboard Shortcuts

As you have noticed, writing Help documentation is not my strong suit.

Eventually, I hope to create Youtube videos that will better explain visually how to use the editor in practice. However, before I can do that, I am in the midst of a redesign of the "Find", "Replace" and "Find in Files" functionality. Similarly, I am adding a fuzzy finder type of search option so you can type in a popup dialog and it will give you fast results for matches on things like filenames, sub/function names, TYPES/ENUMS, etc. That should help making navigation in large projects much easier.

I have just posted a query about getting rid of the Console Window, before finding this post.  Where do I find the Win64 GUI Configuration?

Johan Klassen

@mbw
I couldn't find a gui option either but putting the following at the top of file should work
#cmdline "-s gui"

Paul Squires

QuoteI have just posted a query about getting rid of the Console Window, before finding this post.  Where do I find the Win64 GUI Configuration?
Which application are you using? The older Tiko Editor that was built for traditional FreeBASIC, or the new tkEdit Editor included in the Tiko Programming Language?

Paul Squires
PlanetSquires Software

Paul Squires

FYI: The older Tiko Editor that was built for traditional FreeBASIC does NOT work with tiko programming language
Paul Squires
PlanetSquires Software

Marc Giao

#7
Hi,

Using "tiko programming language" same issue, coming from PB, I need a Tiko for Dummies book!

I've tried adding " #cmdline "-s gui" " but still get the console.

There is no shortage of documentation and examples but I haven't found a minimal windows example that just opens a window so I can then add more controls. I don't want to use forms at this point it would just confuse my old brain even more.

The documentation and examples are fantastic but I am finding it a little overwhelming. At my current point on the Tiko learning curve I just need the bare minimum windows example.

But I keep experimenting... :)
Marc

José Roca

> At my current point on the Tiko learning curve I just need the bare minimum windows example.

If you want Windows only programs, then look at the folder examples/win64.

In the folder examples/win64/Windows Controls Examples you will find examples like this one:

' ########################################################################################
' Microsoft Windows
' Contents: ListBox control
' Compiler: tiko-lang
' Copyright (c) 2026 José Roca. Freeware. Use at your own risk.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################

#import "sys/win"
#import "sys/win/gui"
using win, gui

' // Forward declaration
DECLARE FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

#define IDC_LISTBOX 1001

' ========================================================================================
' Main
' ========================================================================================
FUNCTION main (BYVAL nCmdShow AS LONG = SW_NORMAL) AS LONG

   ' // Set process DPI aware
   SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
   ' // Enable visual styles without including a manifest file
   EnableVisualStyles

   ' // Create the main window
   DIM pWindow AS CWindow = "MyClassName"   ' Use the name you wish
   DIM hWin AS HWND = pWindow.Create(NULL, "CWindow - ListBox control", @WndProc)
   ' // Size it by setting the wanted width and height of its client area
   pWindow.SetClientSize(318, 380)
   ' // Center the window
   pWindow.Center

   ' // Adds a listbox
   DIM hListBox AS HWND = pWindow.AddControl("ListBox", hWin, IDC_LISTBOX)
   pWindow.SetWindowPos hListBox, NULL, 8, 8, 300, 320, SWP_NOZORDER
   ' // Anchor the ListBox
   pWindow.AnchorControl(hListBox, ANCHOR_HEIGHT_WIDTH)

   ' // Fill the list box
   DIM ustrText AS USTRING
   FOR i AS LONG = 1 TO 50
      ustrText = "Item " & RIGHT("00" & WSTR(i), 2)
      ListBox.AddString(hListBox, ustrText)
   NEXT
   ' // Select the first item
   ListBox.SetCursel(hListBox, 0)

   ' // Add a cancel button
   pWindow.AddControl("Button", hWin, IDCANCEL, "&Cancel",  233, 340, 75, 23)
   ' // Anchor the button
   pWindow.AnchorControl(IDCANCEL, ANCHOR_BOTTOM_RIGHT)

   ' // Displays the window and dispatches the Windows messages
   FUNCTION = pWindow.DoEvents(nCmdShow)

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main window procedure
' ========================================================================================
FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

   SELECT CASE uMsg

      ' // If an application processes this message, it should return zero to continue
      ' // creation of the window. If the application returns –1, the window is destroyed
      ' // and the CreateWindowExW function returns a NULL handle.
      CASE WM_CREATE
         EnableDarkModeForWindow(hwnd)
         RETURN 0

      ' // Theme has changed
      CASE WM_THEMECHANGED
         EnableDarkModeForWindow(hwnd)
         RETURN 0

      ' // Sent when the user selects a command item from a menu, when a control sends a
      ' // notification message to its parent window, or when an accelerator keystroke is translated.
      CASE WM_COMMAND
         SELECT CASE CBCTL(wParam, lParam)
            CASE IDCANCEL
               ' // If ESC key pressed, close the application by sending an WM_CLOSE message
               IF CBCTLMSG(wParam, lParam) = BN_CLICKED THEN SendMessageW(hwnd, WM_CLOSE, 0, 0)
            CASE IDC_LISTBOX
               SELECT CASE CBCTLMSG(wParam, lParam)
                  CASE LBN_DBLCLK
                     ' // Get the handle of the Listbox
                     DIM hListBox AS HWND = GetDlgItem(hwnd, IDC_LISTBOX)
                     ' // Get the current selection
                     DIM curSel AS LONG = ListBox.GetCursel(hListBox)
                     DIM ustrText AS USTRING = ListBox.GetText(hListBox, curSel)
                     MessageBoxW(hwnd, ustrText, "ListBox test", MB_OK)
               END SELECT
         END SELECT
         RETURN 0

      CASE WM_DESTROY
         ' // End the application by sending an WM_QUIT message
         PostQuitMessage(0)
         RETURN 0

   END SELECT

   ' // Default processing of Windows messages
   FUNCTION = DefWindowProcW(hwnd, uMsg, wParam, lParam)

END FUNCTION
' ========================================================================================

' ========================================================================================
' // Call main() and return the error code to the OS
' ========================================================================================
END main()
' ========================================================================================

Johan Klassen

Marc Giao
running your program from tkedit will launch a terminal even with #cmdline "-s gui"
but if you compile your program with tkedit using #cmdline "-s gui" and then launch your program by double-clicking then you should see no terminal

José Roca

There are also examples that use dialogs (in the folder examples/win64/CDialog), e.g.

' ########################################################################################
' Microsoft Windows
' Contents: Windows controls - Button with a tooltip
' Compiler: tiko-lang
' Copyright (c) 2026 José Roca. Freeware. Use at your own risk.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################

#import "sys/win"
#import "sys/win/gui"
using win, gui

' // Forward declaration
DECLARE FUNCTION DlgProc (BYVAL hDlg AS HWND, BYVAL uMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LPARAM) AS INT_PTR

CONST IDC_OK = 1001

' ========================================================================================
' Main
' ========================================================================================
FUNCTION main (BYVAL nCmdShow AS LONG = SW_SHOW) AS LONG

   ' // Set process DPI aware
   SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
   ' // Enable visual styles without including a manifest file
   EnableVisualStyles

   ' // Create a new dialog using dialog units
   DIM pDlg AS CDialog
   pDlg.DialogNew(0, "Cialog with a button and tooltip", 50, 50, 175, 65, WS_OVERLAPPEDWINDOW OR DS_CENTER)

   ' // Add a button to the dialog
   DIM hButton AS HWND = pDlg.ControlAdd("Button", IDC_OK, "&Hover me", 105, 40, 50, 12, BS_DEFPUSHBUTTON)

   ' // Add a tooltip to the button
   DIM hTooltip AS HWND = ToolTip.AddTooltip(hButton, "This is a button with a tooltip", TRUE, TRUE)
   ' // Add a caption and an icon to the tooltip
   ToolTip.SetTitle(hTooltip, TTI_INFO, "Caption")

   ' // Anchor the button to the bottom and the right side of the dialog
   pDlg.ControlAnchor(IDC_OK, ANCHOR_BOTTOM_RIGHT)

   ' // Display and activate the dialog as modal
   pDlg.DialogShowModal(@DlgProc)

   RETURN pDlg.DialogEndResult

END FUNCTION
' ========================================================================================

' ========================================================================================
' Dialog callback procedure
' ========================================================================================
FUNCTION DlgProc (BYVAL hDlg AS HWND, BYVAL uMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LPARAM) AS INT_PTR

   ' // Pointer to the dialog class
   STATIC pDlg AS CDialog PTR
  
   SELECT CASE uMsg

      CASE WM_INITDIALOG
         ' // Get a pointer to the CDialog class
         pDlg = cast(CDialog PTR, lParam)
         RETURN TRUE

      CASE WM_COMMAND
         SELECT CASE CBCTL(wParam, lParam)
            CASE IDCANCEL
               ' // If ESC key pressed, close the application by sending an WM_CLOSE message
               IF CBCTLMSG(wParam, lParam) = BN_CLICKED THEN
                  pDlg->DialogSend(WM_CLOSE, 0, 0)
               END IF
            CASE IDC_OK
               MessageBoxW(hDlg, "OK button pressed", "Message", MB_OK)
         END SELECT

      CASE WM_CLOSE
         ' // End the application
         pDlg->DialogEnd(0)

   END SELECT

   RETURN FALSE

END FUNCTION
' ========================================================================================

' ========================================================================================
' // Call main() and return the error code to the OS
' ========================================================================================
END main()
' ========================================================================================

Paul Squires

You guys are correct. Trying to set your file/project to GUI only is needlessly complex.

And to confuse matters more, setting -s gui via #cmdline can be overridden by other project or build settings.

I will work on this tonight to simplify the whole thing.
Paul Squires
PlanetSquires Software


Marc Giao

Quote from: Johan Klassen on November 30, 2026, 08:27:10 PMMarc Giao
running your program from tkedit will launch a terminal even with #cmdline "-s gui"
but if you compile your program with tkedit using #cmdline "-s gui" and then launch your program by double-clicking then you should see no terminal


Thanks Johan,

You are correct, #cmdline "-s gui" does indeed resolve the issue! I was running all my examples from the editor, double clicking the exe opens the window without the console window.

Amazing what you can do when know waht you're doing :)
Marc

Marc Giao

Thanks Jose for the code and the links, I'd already visited most but I was just missing the magic ingredient " #cmdline "-s gui" ". I want to explore Tiko without using forms, I have always coded without forms.
Marc