PlanetSquires Forums

Support Forums => Tiko Programming Language => Topic started by: walt decker on July 08, 2026, 08:36:56 PM

Title: Editor Questions
Post by: walt decker on July 08, 2026, 08:36:56 PM
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.
Title: Re: Editor Questions
Post by: 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.
Title: Re: Editor Questions
Post by: walt decker on July 09, 2026, 01:45:27 PM
Thank you.  I was not looking for preferences in the files menu item.
Title: Re: Editor Questions
Post by: rnbw on November 30, 2026, 05:56:20 PM
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?
Title: Re: Editor Questions
Post by: Johan Klassen on November 30, 2026, 06:34:13 PM
@mbw
I couldn't find a gui option either but putting the following at the top of file should work
#cmdline "-s gui"
Title: Re: Editor Questions
Post by: Paul Squires on November 30, 2026, 06:50:06 PM
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?

Title: Re: Editor Questions
Post by: Paul Squires on November 30, 2026, 06:51:16 PM
FYI: The older Tiko Editor that was built for traditional FreeBASIC does NOT work with tiko programming language
Title: Re: Editor Questions
Post by: Marc Giao on November 30, 2026, 07:34:56 PM
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... :)
Title: Re: Editor Questions
Post by: José Roca on November 30, 2026, 08:22:18 PM
> 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()
' ========================================================================================
Title: Re: Editor Questions
Post by: Johan Klassen on November 30, 2026, 08:27:10 PM
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
Title: Re: Editor Questions
Post by: José Roca on November 30, 2026, 08:27:57 PM
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()
' ========================================================================================
Title: Re: Editor Questions
Post by: Paul Squires on November 30, 2026, 08:29:24 PM
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.
Title: Re: Editor Questions
Post by: José Roca on November 30, 2026, 08:33:29 PM
You can find documentation in the wiki:

CWindow:

https://github.com/PaulSquires/tiko-lang/blob/61c150da9a58b4f233cd0b738ccc97ca21a17381/wiki/CWindow.md

CDialog:

https://github.com/PaulSquires/tiko-lang/blob/61c150da9a58b4f233cd0b738ccc97ca21a17381/wiki/CDialog.md

Windows controls wrappers:

https://github.com/PaulSquires/tiko-lang/tree/61c150da9a58b4f233cd0b738ccc97ca21a17381/pkg/sys/win/gui
Title: Re: Editor Questions
Post by: Marc Giao on November 30, 2026, 08:42:52 PM
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 :)
Title: Re: Editor Questions
Post by: Marc Giao on November 30, 2026, 08:49:09 PM
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.
Title: Re: Editor Questions
Post by: Marc Giao on November 30, 2026, 08:57:12 PM
Quote from: Paul Squires on November 30, 2026, 08:29:24 PMI will work on this tonight to simplify the whole thing.

Thanks Paul, please note that I am finding my way in a new system, not criticizing. Once I get the very, very basics I should be fine.

I've said it before but I think you and Jose have done a fantastic job with Tiko. Thank you!
Title: Re: Editor Questions
Post by: Paul Squires on November 30, 2026, 09:17:36 PM
Thanks @Marc Giao nice of you to say.

After I read your earlier post I went back to the editor and started off fresh like a new user would. It was confusing and I should know how it all ties together!  :-)   I can see and completely understand why someone knew would get lost in the complexity of the Build system.
Title: Re: Editor Questions
Post by: rnbw on December 01, 2026, 07:30:45 AM
Quote from: Johan Klassen on November 30, 2026, 06:34:13 PM@mbw
I couldn't find a gui option either but putting the following at the top of file should work
#cmdline "-s gui"
Thank you Johan.  When the code has been compiled #cmdline "-s gui" works and there is no Console.  If you just run the code from the editor then the console still appears.  This isn't a problem, if you know that's what supposed to happen.
Title: Re: Editor Questions
Post by: Johan Klassen on December 01, 2026, 09:30:41 AM
rnbw
you can also add a GUI build option in settings.toml and then when you press F7 you will have that option as well
open settings.toml
Files->Options->Settings
then add something like the following

[[builds]]
name = 'GUI Release'
options = '-s gui -O2'
default = false

save it then close and relaunch tkedit, now when you press F7 you will be able to choose the GUI build
Title: Re: Editor Questions
Post by: Paul Squires on December 01, 2026, 02:07:48 PM
I have removed and/or simplified all of the confusing build stuff. I have also created dedicated popup dialogs so you can visually select Settings and Project options rather than having to edit the text files. Only some of the more advanced things remain in the text files should you ever need to modify them.

I will package a new release today so that everyone can have access to the new tkEdit.
Title: Re: Editor Questions
Post by: Paul Squires on December 01, 2026, 06:23:17 PM
All the new editor changes are now in the 0.2.0 release: https://www.planetsquires.com/protect/forum/index.php?topic=4910.0